<template>
  <el-dialog title="退回原因" :visible.sync="visible" width="760px" center :before-close="handleClose">
    <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="textarea">
    </el-input>
    <el-button type="primary" size="small" style="margin:20px auto" @click="saveData">确定</el-button>
  </el-dialog>
</template>

<script>
export default {
  name: 'backModel',
  props: ['visible'],
  data() {
    return {
      textarea: ''
    }
  },
  methods: {
    saveData() {
      if (!this.textarea) {
        return this.$message.error('退回原因不能为空')
      }
      this.$emit('returnBack', this.textarea)
    },
    handleClose() {
      this.$emit('close')
    }
  }
}
</script>
<style scoped lang="less"></style>